<template>
		<view class="searchDivZone" :style="{background: bgcolor}" @click="clickSearch">
			<view class="searchZone" :style="{'border-radius': radius + 'px'}">
				<view>
					<uni-icons type="search" style="margin-right: 4rpx;"></uni-icons>
					<text>搜索</text>
				</view>
			</view>
		</view>
</template>

<script setup>
	const emit = defineEmits(['click']);
	
	defineProps({
		//背景颜色
		bgcolor: {
			type: String,
			default: '#C00000'
		},
		//圆角尺寸
		radius: {
			type: Number,
			default: 18
		}
	})
	
	//处理点击事件
	const clickSearch = () => {
		emit('click');
		console.log("点击了子组件");
	}
</script>

<style lang="scss">
	.searchDivZone{
		// background: #C00000;
		height: 50px;
		width: 100vw;
		display: flex;
		justify-content: center;
		align-items: center;
		.searchZone{
			width: 85%;
			background-color: #fff;
			height: 36px;
			display: flex;
			justify-content: center;
			align-items: center;
			// border-radius: 18px;
		}
	}	
</style>